<template>
    <div>
        <el-table  :data="table.rowData" stripe border    :show-summary="isSum"  class="company-table" style="width: 100%;" :height="outHeight" >
            <el-table-column prop="useNurseName" label="护士姓名" sortable min-width="90"></el-table-column>
            <el-table-column prop="providerNum" label="绑定浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="volunteeNum" label="发展义工数" sortable min-width="90"></el-table-column>
            <el-table-column prop="vpNum" label="义工绑定浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="a" label="绑定A类浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="b" label="绑定B类浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="c" label="绑定C类浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="d" label="绑定D类浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="e" label="绑定E类浆员数" sortable min-width="90"></el-table-column>
            <el-table-column prop="curUnBindNum" label="今年绑定前献浆数" sortable min-width="90"></el-table-column>
            <el-table-column prop="curBindToNearNum" label="今年绑定后至上轮" sortable min-width="90"></el-table-column>
            <el-table-column prop="curAfterMaxNum" label="今年后期最大" sortable min-width="90"></el-table-column>
            <el-table-column prop="curTheoryAddNum" label="今年理论增加" sortable min-width="90"></el-table-column>
        </el-table>
    </div>
</template>
<script>
import bloodSourcesHttp from 'plugins/axios/bloodSourcesHttp.js';
export default {
    data(){
        return { 
            isSum:true,  
            table:{
                option:{
                    loading:true  
                },
                sum:{
                   useNurseName:'合计',
                   providerNum:0,
                   volunteeNum:0,
                   vpNum:0,
                   a:0,
                   b:0,
                   c:0,
                   d:0,
                   e:0,
                   curUnBindNum:0,
                   curBindToNearNum:0,
                   curAfterMaxNum:0,
                   curTheoryAddNum:0    
                },
                rowData:[]
            }
        }
    },
    mounted(){
       let self = this;
       self.init(); 
    },
    computed:{
        outHeight(){//外部表格高度
            return this.$store.state.clientHeight-180;
        },
    },
    methods:{
        //初始化
        init(){
            let self = this;
            self.isSum = true;
            self.queryTable();
        },
        queryTable(){
            let self = this;
            bloodSourcesHttp.getTableXyVolunteeInfo().then(res=>{
                self.table.rowData = res.content;
                self.table.option.loading = false;
            });
        },
        //自定义合计行
        autoSumRow(row){
            let self = this;
            self.table.sum.providerNum= Number(self.table.sum.providerNum)+Number(row.providerNum);
            console.log(self.table.sum);
        },
        //生成合计数据
        insertSum(){
            let self  = this;
            self.table.rowData.unshift(self.table.sum);
        }
       
    }
    
}
</script>
<style scoped>
.el-table{
overflow:visible !important;
}
</style>